<template>
	<view class="session_page">
		<scroll-view class="session_list" :style="{height: scrollHeight}" scroll-y @scrolltolower="lower">
			<publish @reloadCommunity="reloadCommunity" />
			<recommend ref="recommend" />
		</scroll-view>
	</view>
</template>

<script>
	import recommend from "@/components/community/recommend.vue"
	import publish from "@/components/community/publish.vue"
	export default {
		components: {
			recommend,
			publish
		},
		data() {
			return {
				scrollHeight:"100%",
			}
		},
		mounted() {
			this.getTelephoneInfo();
		},
		methods: {
			// 到达底部
			lower(){
				this.$refs.recommend.loadMore();
			},
			// 重新获取社区列表数据
			reloadCommunity(){
				this.$refs.recommend.reloadCommunityList();
			},
			//获取设备信息
				async getTelephoneInfo() {
					var telephoneInfo = await this.$Common.getTelephoneInfo();
					this.scrollHeight = telephoneInfo.screenHeight+ 'px';
				},
		}
	}
</script>

<style lang="scss" scoped>
	.session_page {
		height: 100%;
		width: 100%;

		.session_list {
			height: 100%;
			width: 100%;
			overflow: auto
		}
	}
</style>
